<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>IBustText</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<link rel="home" href="index.html" title="IBust Reference Manual">
<link rel="up" href="ch02.html" title="Panel (User Interfaces)">
<link rel="prev" href="IBustPropList.html" title="IBustPropList">
<link rel="next" href="ch03.html" title="Input method engine">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="IBustPropList.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">IBust Reference Manual</th>
<td><a accesskey="n" href="ch03.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#IBustText.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#IBustText.description" class="shortcut">Description</a>
                   | 
                  <a href="#IBustText.object-hierarchy" class="shortcut">Object Hierarchy</a>
</td></tr>
</table>
<div class="refentry">
<a name="IBustText"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="IBustText.top_of_page"></a>IBustText</span></h2>
<p>IBustText — Text with decorating information.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="IBustText.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">struct              <a class="link" href="IBustText.html#IBustText-struct" title="struct IBustText">IBustText</a>;
struct              <a class="link" href="IBustText.html#IBustTextClass" title="struct IBustTextClass">IBustTextClass</a>;
<span class="returnvalue">void</span>                <a class="link" href="IBustText.html#ibust-text-append-attribute" title="ibust_text_append_attribute ()">ibust_text_append_attribute</a>          (<em class="parameter"><code><a class="link" href="IBustText.html" title="IBustText"><span class="type">IBustText</span></a> *text</code></em>,
                                                         <em class="parameter"><code><span class="type">guint</span> type</code></em>,
                                                         <em class="parameter"><code><span class="type">guint</span> value</code></em>,
                                                         <em class="parameter"><code><span class="type">guint</span> start_index</code></em>,
                                                         <em class="parameter"><code><span class="type">gint</span> end_index</code></em>);
<a class="link" href="IBustAttrList.html" title="IBustAttrList"><span class="returnvalue">IBustAttrList</span></a> *      <a class="link" href="IBustText.html#ibust-text-get-attributes" title="ibust_text_get_attributes ()">ibust_text_get_attributes</a>            (<em class="parameter"><code><a class="link" href="IBustText.html" title="IBustText"><span class="type">IBustText</span></a> *text</code></em>);
<span class="returnvalue">gboolean</span>            <a class="link" href="IBustText.html#ibust-text-get-is-static" title="ibust_text_get_is_static ()">ibust_text_get_is_static</a>             (<em class="parameter"><code><a class="link" href="IBustText.html" title="IBustText"><span class="type">IBustText</span></a> *text</code></em>);
<span class="returnvalue">guint</span>               <a class="link" href="IBustText.html#ibust-text-get-length" title="ibust_text_get_length ()">ibust_text_get_length</a>                (<em class="parameter"><code><a class="link" href="IBustText.html" title="IBustText"><span class="type">IBustText</span></a> *text</code></em>);
const <span class="returnvalue">gchar</span> *       <a class="link" href="IBustText.html#ibust-text-get-text" title="ibust_text_get_text ()">ibust_text_get_text</a>                  (<em class="parameter"><code><a class="link" href="IBustText.html" title="IBustText"><span class="type">IBustText</span></a> *text</code></em>);
<a class="link" href="IBustText.html" title="IBustText"><span class="returnvalue">IBustText</span></a> *          <a class="link" href="IBustText.html#ibust-text-new-from-printf" title="ibust_text_new_from_printf ()">ibust_text_new_from_printf</a>           (<em class="parameter"><code>const <span class="type">gchar</span> *fmt</code></em>,
                                                         <em class="parameter"><code>...</code></em>);
<a class="link" href="IBustText.html" title="IBustText"><span class="returnvalue">IBustText</span></a> *          <a class="link" href="IBustText.html#ibust-text-new-from-static-string" title="ibust_text_new_from_static_string ()">ibust_text_new_from_static_string</a>    (<em class="parameter"><code>const <span class="type">gchar</span> *str</code></em>);
<a class="link" href="IBustText.html" title="IBustText"><span class="returnvalue">IBustText</span></a> *          <a class="link" href="IBustText.html#ibust-text-new-from-string" title="ibust_text_new_from_string ()">ibust_text_new_from_string</a>           (<em class="parameter"><code>const <span class="type">gchar</span> *str</code></em>);
<a class="link" href="IBustText.html" title="IBustText"><span class="returnvalue">IBustText</span></a> *          <a class="link" href="IBustText.html#ibust-text-new-from-ucs4" title="ibust_text_new_from_ucs4 ()">ibust_text_new_from_ucs4</a>             (<em class="parameter"><code>const <span class="type">gunichar</span> *str</code></em>);
<a class="link" href="IBustText.html" title="IBustText"><span class="returnvalue">IBustText</span></a> *          <a class="link" href="IBustText.html#ibust-text-new-from-unichar" title="ibust_text_new_from_unichar ()">ibust_text_new_from_unichar</a>          (<em class="parameter"><code><span class="type">gunichar</span> c</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="IBustText.html#ibust-text-set-attributes" title="ibust_text_set_attributes ()">ibust_text_set_attributes</a>            (<em class="parameter"><code><a class="link" href="IBustText.html" title="IBustText"><span class="type">IBustText</span></a> *text</code></em>,
                                                         <em class="parameter"><code><a class="link" href="IBustAttrList.html" title="IBustAttrList"><span class="type">IBustAttrList</span></a> *attrs</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="IBustText.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  GObject
   +----GInitiallyUnowned
         +----<a class="link" href="IBustObject.html" title="IBustObject">IBustObject</a>
               +----<a class="link" href="IBustSerializable.html" title="IBustSerializable">IBustSerializable</a>
                     +----IBustText
</pre>
</div>
<div class="refsect1">
<a name="IBustText.description"></a><h2>Description</h2>
<p>
An IBustText is the main text object in IBust.
The text is decorated according to associated IBustAttribute,
e.g. the foreground/background color, underline, and
applied scope.
</p>
</div>
<div class="refsect1">
<a name="IBustText.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="IBustText-struct"></a><h3>struct IBustText</h3>
<pre class="programlisting">struct IBustText {
    gboolean is_static;
    gchar  *text;
    IBustAttrList *attrs;
};
</pre>
<p>
A text object in IBust.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><span class="type">gboolean</span> <em class="structfield"><code><a name="IBustText-struct.is-static"></a>is_static</code></em>;</span></p></td>
<td>Whether <em class="parameter"><code>text</code></em> is static, i.e., no need and will not be freed. Only TRUE if IBustText is newed from <a class="link" href="IBustText.html#ibust-text-new-from-static-string" title="ibust_text_new_from_static_string ()"><code class="function">ibust_text_new_from_static_string()</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">gchar</span> *<em class="structfield"><code><a name="IBustText-struct.text"></a>text</code></em>;</span></p></td>
<td>The string content of IBustText in UTF-8.</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="IBustAttrList.html" title="IBustAttrList"><span class="type">IBustAttrList</span></a> *<em class="structfield"><code><a name="IBustText-struct.attrs"></a>attrs</code></em>;</span></p></td>
<td>Associated IBustAttributes.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="IBustTextClass"></a><h3>struct IBustTextClass</h3>
<pre class="programlisting">struct IBustTextClass {
    IBustSerializableClass parent;
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="ibust-text-append-attribute"></a><h3>ibust_text_append_attribute ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                ibust_text_append_attribute          (<em class="parameter"><code><a class="link" href="IBustText.html" title="IBustText"><span class="type">IBustText</span></a> *text</code></em>,
                                                         <em class="parameter"><code><span class="type">guint</span> type</code></em>,
                                                         <em class="parameter"><code><span class="type">guint</span> value</code></em>,
                                                         <em class="parameter"><code><span class="type">guint</span> start_index</code></em>,
                                                         <em class="parameter"><code><span class="type">gint</span> end_index</code></em>);</pre>
<p>
Append an IBustAttribute for IBustText.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td>
<td>an IBustText</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td>IBustAttributeType for <em class="parameter"><code>text</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
<td>Value for the type.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>start_index</code></em> :</span></p></td>
<td>The starting index, inclusive.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>end_index</code></em> :</span></p></td>
<td>The ending index, exclusive.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="ibust-text-get-attributes"></a><h3>ibust_text_get_attributes ()</h3>
<pre class="programlisting"><a class="link" href="IBustAttrList.html" title="IBustAttrList"><span class="returnvalue">IBustAttrList</span></a> *      ibust_text_get_attributes            (<em class="parameter"><code><a class="link" href="IBustText.html" title="IBustText"><span class="type">IBustText</span></a> *text</code></em>);</pre>
<p>
Return the attributes in an IBustText. Should not be freed.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td>
<td>An IBustText.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the attrs in <em class="parameter"><code>text</code></em>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="ibust-text-get-is-static"></a><h3>ibust_text_get_is_static ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>            ibust_text_get_is_static             (<em class="parameter"><code><a class="link" href="IBustText.html" title="IBustText"><span class="type">IBustText</span></a> *text</code></em>);</pre>
<p>
Return the is_static in an IBustText.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td>
<td>An IBustText.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the is_static in <em class="parameter"><code>text</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="ibust-text-get-length"></a><h3>ibust_text_get_length ()</h3>
<pre class="programlisting"><span class="returnvalue">guint</span>               ibust_text_get_length                (<em class="parameter"><code><a class="link" href="IBustText.html" title="IBustText"><span class="type">IBustText</span></a> *text</code></em>);</pre>
<p>
Return number of characters in an IBustText.
This function is based on <code class="function">g_utf8_strlen()</code>, so unlike <code class="function">strlen()</code>,
it does not count by bytes but characters instead.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td>
<td>An IBustText.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Number of character in <em class="parameter"><code>text</code></em>, not counted by bytes.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="ibust-text-get-text"></a><h3>ibust_text_get_text ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> *       ibust_text_get_text                  (<em class="parameter"><code><a class="link" href="IBustText.html" title="IBustText"><span class="type">IBustText</span></a> *text</code></em>);</pre>
<p>
Return the text in an IBustText. Should not be freed.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td>
<td>An IBustText.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the text in <em class="parameter"><code>text</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="ibust-text-new-from-printf"></a><h3>ibust_text_new_from_printf ()</h3>
<pre class="programlisting"><a class="link" href="IBustText.html" title="IBustText"><span class="returnvalue">IBustText</span></a> *          ibust_text_new_from_printf           (<em class="parameter"><code>const <span class="type">gchar</span> *fmt</code></em>,
                                                         <em class="parameter"><code>...</code></em>);</pre>
<p>
New an IBustText from a printf expression.
</p>
<p>
The result of printf expression is stored in the new IBustText instance.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>fmt</code></em> :</span></p></td>
<td>printf format string.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
<td>arguments for <em class="parameter"><code>fmt</code></em>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A newly allocated IBustText.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="ibust-text-new-from-static-string"></a><h3>ibust_text_new_from_static_string ()</h3>
<pre class="programlisting"><a class="link" href="IBustText.html" title="IBustText"><span class="returnvalue">IBustText</span></a> *          ibust_text_new_from_static_string    (<em class="parameter"><code>const <span class="type">gchar</span> *str</code></em>);</pre>
<p>
New an IBustText from a static string.
</p>
<p>
Since <em class="parameter"><code>str</code></em> is a static string which won't be freed.
This function will NOT duplicate <em class="parameter"><code>str</code></em>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td>
<td>An text string to be set.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A newly allocated IBustText.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="ibust-text-new-from-string"></a><h3>ibust_text_new_from_string ()</h3>
<pre class="programlisting"><a class="link" href="IBustText.html" title="IBustText"><span class="returnvalue">IBustText</span></a> *          ibust_text_new_from_string           (<em class="parameter"><code>const <span class="type">gchar</span> *str</code></em>);</pre>
<p>
New an IBustText from a string.
</p>
<p>
<em class="parameter"><code>str</code></em> will be duplicated in IBustText, so feel free to free <em class="parameter"><code>str</code></em> after this function.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td>
<td>An text string to be set.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A newly allocated IBustText.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="ibust-text-new-from-ucs4"></a><h3>ibust_text_new_from_ucs4 ()</h3>
<pre class="programlisting"><a class="link" href="IBustText.html" title="IBustText"><span class="returnvalue">IBustText</span></a> *          ibust_text_new_from_ucs4             (<em class="parameter"><code>const <span class="type">gunichar</span> *str</code></em>);</pre>
<p>
New an IBustText from an UCS-4 encoded string.
</p>
<p>
<em class="parameter"><code>str</code></em> will be duplicated in IBustText, so feel free to free <em class="parameter"><code>str</code></em> after this function.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>str</code></em> :</span></p></td>
<td>An text string to be set.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A newly allocated IBustText.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="ibust-text-new-from-unichar"></a><h3>ibust_text_new_from_unichar ()</h3>
<pre class="programlisting"><a class="link" href="IBustText.html" title="IBustText"><span class="returnvalue">IBustText</span></a> *          ibust_text_new_from_unichar          (<em class="parameter"><code><span class="type">gunichar</span> c</code></em>);</pre>
<p>
New an IBustText from a single UCS4-encoded character.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td>
<td>A single UCS4-encoded character.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A newly allocated IBustText.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="ibust-text-set-attributes"></a><h3>ibust_text_set_attributes ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                ibust_text_set_attributes            (<em class="parameter"><code><a class="link" href="IBustText.html" title="IBustText"><span class="type">IBustText</span></a> *text</code></em>,
                                                         <em class="parameter"><code><a class="link" href="IBustAttrList.html" title="IBustAttrList"><span class="type">IBustAttrList</span></a> *attrs</code></em>);</pre>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>text</code></em> :</span></p></td>
<td>An IBustText.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>attrs</code></em> :</span></p></td>
<td>An IBustAttrList</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="IBustText.see-also"></a><h2>See Also</h2>
<a class="link" href="IBustAttribute.html" title="IBustAttribute"><span class="type">IBustAttribute</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>